package com.googlecode.vmock;

/**
 * The enumeration of stages in the {@link MockController}.
 * 
 * @author marcin.jagus
 */
enum MockStage {

    /**
     * This is the first stage of a mocking workflow. It is a more of a informative stage which tells the end user that the mocking mechanism can
     * start recording any time.
     */
    INITIALIZED,

    /**
     * This is the second stage of a mocking workflow. It allows the end user to specify which method calls should be mocked and what result of those
     * calls should be.<br/>
     * The only way to start this stage is to call {@link VMock#record(Object)} method. This method requires one parameter called the <i>recording
     * owner</i>. Only calls made from <i>recording owner</i> can be mocked in RECORDING stage. Those calls will always return <code>null</code>
     * without calling the target method. Thanks to this approach, partial mocks can be created.
     */
    RECORDING,

    /**
     * This stage informs the {@link CallInterceptorAspect} that it should not intercept any new calls. This stage is used specifically to change the
     * recording owner if necessary. End user can force mock controller to enter this stage by calling {@link VMock#pause()}. There is no other way to
     * enter this stage.
     */
    RECORDING_PAUSED,

    /**
     * {@link MockController} enters this stage after registering a new recorded call. End user cannot change the stage until an expected result is
     * set for the last recorded call. Every attempt of changing this stage to any other (by calling {@link VMock#replay()} for example) should end
     * with an exception.<br/>
     * After specifying an expected result, {@link MockController} will automatically return to the RECORDING stage.
     */
    RECORDING_AWAITING_RESULT,

    /**
     * In this stage the application logic should be run. Calls that have been mocked in {@link #RECORDING} stage will return mocked results.
     */
    REPLAYING,

    /**
     * In this stage, the {@link MockController} checks if all the mocked calls where called appropriate number of times with expected parameters.
     */
    VERIFYING;
}
